class Introduce < ActiveRecord::Base

  validates :content, presence: true
  validates :flag, presence: true

  scope :description, -> { where(flag: 'description') }

  scope :service, -> { where(flag: 'service') }

  scope :customer, -> { where(flag: 'customer') }

  scope :partner, -> { where(flag: 'partner') }

  scope :chinese, ->  { where(language: 1) }

  scope :english, -> { where(language: 2) }

  scope :traditional, ->  { where(language: 3) }

  scope :flag, -> (flag) { where(flag: flag) }

  scope :language, -> (language) { where(language: language) }

end
